﻿using System.Xml;
using UnityEngine;

namespace EditorFrameWork
{
    public class XMLGUILayoutVertical : XMLGUIContainedBase
    {
        public bool Box { get; set; }

        public override void ParseXML(XmlElement xmlElement, XMLGUI roolXMLGUI)
        {
            base.ParseXML(xmlElement, roolXMLGUI);
            Box =  GetAttributeValue<bool>(xmlElement, "box");
        }

        public override void OnGUI(Rect position)
        {
            base.OnGUI(position);
            if (Box)
            {
                GUILayout.BeginVertical("box");
            }
            else
            {
                GUILayout.BeginVertical();
            }

            Xmlgui.Draw();
            GUILayout.EndVertical();
        }

        protected override void OnDispose()
        {
        }
    }
}